<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
	/**
	 * 设为主页
	 * @param obj 参数为this
	 */
	function SetHome(obj) {
		try {
			// 仅对IE有效
			var url = window.location.href; //获取当前url地址
			obj.style.behavior = 'url(#default#homepage)';
			obj.setHomePage(url);
			alert("修改成功");
		} catch (e) {
			if (window.netscape) {
				try {
					netscape.security.PrivilegeManager
							.enablePrivilege("UniversalXPConnect");
				} catch (e) {
					alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
				}
				var prefs = Components.classes['@mozilla.org/preferences-service;1']
						.getService(Components.interfaces.nsIPrefBranch);
				prefs.setCharPref('browser.startup.homepage', url);
			}
		}
	}
	/**
	 * 收藏本页：对chrome无效
	 */
	function addFavorite() {
		var url = window.location.href; //获取当前url地址
		var title = document.title; //获取当前网站标题
		try {
			window.external.addFavorite(url, title);
		} catch (e) {
			try {
				window.sidebar.addPanel(title, url, "");
			} catch (e) {
				alert("加入收藏失败,请手动添加.");
			}
		}
	}
</script>
<title>导航网 - 首页</title>
</head>
<body>
	<div class="header">
		<div class="header_menu">
			<p>常用功能：设置为主页、更换皮肤等</p>
			<p>
				<a href="javascript:void(0)" onclick="SetHome(this)">设为主页</a>
			</p>
			<p>
				<a href="javascript:void(0)" onclick="addFavorite()">添加收藏</a>
			</p>
		</div>
		<div class="header_main">
			<p>站内宣传广告、搜索引擎、天气预报等</p>
		</div>

	</div>
	<div class="content" id="main">
		<div class="content_left">
			<p>左边栏</p>
		</div>
		<div class="content_right">
			<p>右边栏</p>
		</div>
	</div>
	<div class="ad">广告栏</div>
	<div class="footer">
		<p>页脚A：版权声明、意见反馈链接、备案信息等</p>
	</div>
</body>
</html>